<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	Status: <h4>${error}</h4>
	<form action="crudAdmin.do" method="post">
	<table>
    	<tr>
        	<td>
            	ID
            </td>
            
            <td>	
            	<input name="txtId" readonly="readonly" type="text" value="${entityAdmin.id}"/>
            </td>
    	</tr>
    	
    	<tr>
    		<td> Name </td>
    		<td> <input name="txtName" type="text" value="${entityAdmin.name}"/> </td>
    	</tr>
    	
    	<tr>
    		<td> Password </td>
    		<td> <input name="txtPassword" type="text" value="${entityAdmin.password}"/> </td>
    	</tr>
    	
    	<tr>
    		<td> Email </td>
    		<td>
    		<input type="email" name="txtEmail"value="${entityAdmin.email}"/> </td>
    	</tr>
    	
    	<tr>
    		<td> is Administrator </td>
    		<td> 
    		<input name="txtId" readonly="readonly" type="checkbox" ${entityAdmin.admin? "checked='checked'": ""}/> </td>
    	</tr>
    	
    	<tr>
    		<td colspan="2"> 
	    		<input type="submit" name="btnCreate" value="Create">
				<input type="submit" name="btnUpdate" value="Update">
				<input type="submit" name="btnDelete" value="Delete">
				<input type="submit" name="btnRefresh" value="Refresh">
    		</td>
    	</tr>
    </table>
    </form>
    
    <h1>DANH SÁCH TÀI KHOẢN NHÂN VIÊN</h1>
	<table border="1" width="100%">
	<tr bgcolor="lightgray">
		<td>Id</td>
		<td>Name</td>
		<td>Email</td>
		<td>isAdmin</td>
		<td> </td>
	</tr>
	
	<c:forEach var="c" items="${showAdmin}">
	<tr>
		<td>${c.id}</td>
		<td>${c.name}</td>
		<td>${c.email}</td>
		<td>${c.admin}</td>
		<td><a href="crudAdmin.do?adminId=${c.id}">Chi tiết</a></td>
	</tr>
	</c:forEach>
	</table>
</body>
</html>